﻿using MediatR;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using SCM.API.Read.Application.Command.SaleRefund;
using SCM.Domain;
using SCM.ErrorCode;

namespace SCM.API.Read.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    
    public class SaleRefundController : ControllerBase
    {
        IMediator mediator;

        public SaleRefundController(IMediator mediator)
        {
            this.mediator = mediator;
        }
      
        [HttpGet]
        public async Task<APIResult<SaleRefundModel>> GetSaleRefund([FromQuery]GetSaleRefundCommand request)
        {
            return await mediator.Send(request);
        }
    }
}
